<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <title>courseupdate.jsp</title>

    <meta content="no-cache" http-equiv="pragma">
    <meta content="no-cache" http-equiv="cache-control">
    <meta content="0" http-equiv="expires">
    <meta content="keyword1,keyword2,keyword3" http-equiv="keywords">
    <meta content="This is my page" http-equiv="description">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    <script type="text/javascript">
        function a() {
            var flag = false;
            var c_name = document.getElementById("c_name").value;
            var c_time = document.getElementById("c_time").value;
            var c_teacher_id = document.getElementById("c_teacher_id").value;
            var c_isable = document.getElementById("c_isable").value;
            if (c_name === "") {
                alert("课程名称不能为空");
            } else if (c_time === "") {
                alert("开课时间不能为空");
            } else if (c_teacher_id === "") {
                alert("授课教师编号不能为空");
            } else if (c_isable === "") {
                alert("是否可选不能为空");
            } else {
                flag = true;
            }
            return flag;
        }
    </script>

    <style type="text/css">
        .readonly {
            background-color: darkgrey;
        }

    </style>
</head>

<body>
<div>课程信息修改</div>
<form action="${ctx}/AdminCoursesUpdateAction" method="post">
    <table>
        <tr>
            <td>课程编号</td>
            <td><input name="c_id" type="text" value="${lstt[0]}" class="readonly" readonly="readonly"/></td>
        </tr>
        <tr>
            <td>课程名称</td>
            <td><input id="c_name" name="c_name" value="${lstt[1]}"/></td>
        </tr>
        <tr>
            <td>开课时间</td>
            <td>
                <input id="c_time" name="c_time" value="${lstt[2]}"/></td>
        </tr>
        <tr>
            <td>授课教师编号</td>
            <td><input id="c_teacher_id" name="c_teacher_id" value="${lstt[3]}"/></td>
        </tr>
        <tr>
            <td>是否可选</td>
            <td><input id="c_isable" name="c_isable" value="${lstt[4]}" class="readonly" readonly="readonly"/></td>
        </tr>
        <tr>
            <td><input onclick="return a()" type="submit" value="修改"/></td>
        </tr>
    </table>
</form>
<a href="${ctx}/AdminCoursesFindAll">返回</a>
</body>
</html>
